Skip to main content

Full text of "Circuits"

See other formats


Automatic Dimming Nightlight 



Make] Projects 

hhiiilH ho/ 1 !/ tuMaal/ chare r\icf*f\\tat* 



build, hack, tweak, share, discover,- 



Automatic Dimming Nightlight 



Written By: Jason Poel Smith 



TOOLS: 



Drill (1) 
Soldering iron (1) 



PARTS: 



6V 400mA DC power supply (or similar) 

01 

Its open-circuit voltage (no load) 

measured by a volt meter is 

approximately 10 V. With the load of this 

project the operating voltage is about 

9.5V 

Project box (1) 

Momentary push-button switch (1) 

SPST latching switch (1) 

3.0-3.5V LED (3) 

diode (1N4001 or similar) (1) 

2200uF 10V capacitor (2) 

Resistors. 1/4W: 3.3MQ (1) 

Resistors. 1/4W:2.2kQ (1) 

Potentiometer, 5kQ (1) 

Resistors. 1/4W: 1MQ(1) 

Terminal connectors (1) 

741 OP AMP (2) 



© Make Projects 



www.makeprojects.com 



Page 1 of 7 



Automatic Dimming Nightlight 



Printed Circuit Board (1) 
Jumper wires (1) 



SUMMARY 

A lot of people find it easier to fall asleep with a dim light such as a nightlight in the room. 
But the down side of most nightlights is that they waste electricity because they are on all 
night when you really only need them to be on while you are falling asleep. So I designed a 
nightlight that will automatically dim and turn itself off. 

Here is a brief video of the build: 



Step 1 — Circuit 




• The circuit can be broken into two 
main parts, a timer circuit and a 
dimming circuit. The timer (left) is 
made from a 741 OP AMP wired as 
a comparator. The dimmer (right) is 
made from 741 OP AMP wired as a 
voltage follower (or a unity gain 
amplifier) 



© Make Projects 



www.makeprojects.com 



Page 2 of 7 



Automatic Dimming Nightlight 



Step 2 — Timer circuit 




• The timer is made from a 741 op 
amp (operational amplifier) wired 
as a comparator. It compares the 
voltage across a capacitor with a 
reference voltage that is set by the 
2.2k resistor and the 5k 
potentiometer. 

• When S2 is pressed the capacitor 
is charged to the supply voltage. It 
then gradually discharges through 
the 1M resistor. As long as the 
voltage across the capacitor is 
greater than the reference voltage, 
the output of the op amp is high 
(about 8.7V). When the voltage 
across the capacitor drops below 
the reference, the output of the op 
amp goes low (about 1.9V). This 
can take 0-45 minutes depending 
on how the potentiometer is set. 



© Make Projects 



www.makeprojects.com 



Page 3 of 7 



Automatic Dimming Nightlight 



Step 3 — Dimmer Circuit 




• While the output of the timer is 
HIGH, it keeps the second 
capacitor charged. When the timer 
output goes LOW, this capacitor 
begins to slowly discharge through 
the 3.3M resistor. This begins the 
dimming cycle. The output of the 
second 741 op amp mirrors the 
voltage across the capacitor. As 
the voltage across the second 
capacitor drops, so does the output 
voltage and the LEDs dim. It should 
take about 45 minutes for the LEDs 
to go from full brightness to full 
darkness. Pressing the button at 
any point will reset the whole cycle. 



Step 4 — Breadboard Prototype 




• Testing your circuit on a 

breadboard before soldering can 
help work out bugs. 



© Make Projects 



www.makeprojects.com 



Page 4 of 7 



Automatic Dimming Nightlight 



Step 5 — Solder the circuit together on the circuit board. 



mm 







• Then if the breadboard prototype works, solder it onto a circuit board. In order to conserve 
space I am stacking some components. When you are done soldering, trim your board to 
help it fit in the housing. 



Step 6 — Add surface components. 






• To connect the variable resistor, I am using a strip of PC jumper wires with some of the 
wires trimmed off. For my light source I am using three LEDs in series whose combined 
voltages is close to the supply voltage so I am forgoing adding a resistor. I tend to use a 
lot of heat shrink tubing to insulate my solder connections. I find that it helps avoid 
unwanted shorts. 



© Make Projects 



www.makeprojects.com 



Page 5 of 7 



Automatic Dimming Nightlight 



Step 7 — Find/make a suitable housing 




• Once you have the circuit constructed, find a suitable housing. Then drill some holes for 
the LEDs, the switches, the dial and the power cord. Trim your circuit board so that it is 
only as big as it has to be. This will really help when it comes to fitting everything in the 
housing. Finally, load in all the components and your project is complete. 



Step 8 — Test the finished product 




• The last step is making it look nice. If you want, you can added a diffuser or something to 
scatter the light. You can tint the LEDs using gels or just liquid highlighter. The final 
aesthetic details are up to you. I put mine in a decorative lantern. 



© Make Projects 



www.makeprojects.com 



Page 6 of 7 



Automatic Dimming Nightlight 



Step 9 — Modify the design 




• The duration of time that the lights 
are on at full brightness and the 
time that they dim can be modified 
by changing the values of R1 , C1 , 
R4 and C2. By changing the ratios 
of the resistors and capacitors you 
change how quickly the capacitors 
will discharge. For a decent 
estimate of how the capacitors will 
discharge you can use the formula 

V c =V xe(" t/RC ). Feel free to change 
the values to meet your needs. 



This document was last generated on 201 2-1 1 -02 04:52:52 AM. 



© Make Projects 



www.makeprojects.com 



Page 7 of 7